#include "Vector3.h"

Vector3::Vector3( void ) :
D3DXVECTOR3( 0, 0, 0 )
{
}

Vector3::Vector3( float fx, float fy, float fz ) :
D3DXVECTOR3( fx, fy, fz )
{
}

Vector3::Vector3( const D3DXVECTOR3 & vector )
{
	*static_cast<D3DXVECTOR3*>(this) = vector;
}

Vector3::~Vector3( void )
{
}

void Vector3::Set( float fx, float fy, float fz )
{
	x = fx;
	y = fy;
	z = fz;
}

Vector3 Vector3::GetCrossProduct( const Vector3 & other )
{
	Vector3 result;
	D3DXVec3Cross( &result, this, &other );

	return result;
}

Vector3 Vector3::Lerp( const Vector3 & other, const float ratio )
{
	Vector3 result;
	D3DXVec3Lerp( &result, this, &other, ratio );

	return result;
}

float Vector3::GetDistanse( const Vector3 & other )
{
	Vector3 result = *this - other;
	return result.GetLength();
}